<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view' );

class pqceViewpqce extends JView
{
	function display($tpl = null)
	{
		$params = &JComponentHelper::getParams("com_pqce");
//		$exc= $params->_registry['_default']['data']->exclude;
		$exc=$params->get('exclude');
		if (strpos(strtolower($exc),'pqce') !== false){
			JError::raiseError(403, JText::_('Access Forbidden'));
		}
		$m=JRequest::getVar('month','');
		$y=JRequest::getVar('year','');
		$d= JRequest::getVar('day','');
		$id=JRequest::getVar('e',0,'','int');
		$this->loadHelper('base');
		$e=new qcalendareBase($d,$m,$y);

		$cell=$e->createBody();
		$this->assignRef('weeksInMonth',$e->weeksInMonth);

		$href=$e->createHrefHeader();
		$this->assignRef('href',$href);
		$this->assignRef('cell',$cell);
		$this->assignRef('month',$e->month);
		$this->assignRef('year',$e->year);
		$this->assignRef('day',$e->day);
		$type=null;
		if ($id>0){
			$singleEvent=&$e->createLongDescEvent($id);
			if ($singleEvent[0]) {$type='desc'; $d=0; $this->assignRef('lDesc',$singleEvent);}
		}
		if ($d>0){
			$lDesc=& $e->createLongDescDay($d,$e->month,$e->year);
			$this->assignRef('lDesc',$lDesc);
			$type='desc';
		}
		$this->assignRef('type',$type);
		parent::display($tpl);
	}
}
